<?php
class adm_admin extends core_modbase {
	protected $acl;
	
	function __construct($adm)
	{
		$this->template = new template();
		$this->translator = new translator();
		$session = new session();
		$this->acl = &$adm->acl;
				
		if ($this->acl->right('/admin/settings'))
		{
			$menu = array(
				'msettings' => array('mgsettings' => core_settings::Get('sitepath') . 'admin/settings')
			);
			core_signal::SmpSignal('admin::menu', $menu);
		}
		
		if ($this->acl->right('/admin/settings/access'))
		{
			$menu = array(
				'msettings' => array('mgaccess' => core_settings::Get('sitepath') . 'admin/settings/access')
			);
			core_signal::SmpSignal('admin::menu', $menu);
		}
		
		if ($adm->acl->right('/admin/theme/widget'))
		{
			$menu = array(
				'mtheme' => array('mwidget' => core_settings::Get('sitepath') . 'admin/settings/widgetlist')
			);
			core_signal::SmpSignal('admin::menu', $menu);
		}
	}
	
	function PAGE_index() {
		return 'page';
	}
	
	function PAGE_widgetlist() {
		$this->acl->force('/admin/widget');
	}

	function PAGE_access($url = null) {
		$this->acl->force('/admin/settings/access');
		return $this->fetch('access-list.html');
	}
	
}